package roboSoccer;

public class TbRandomBallMovement extends TeamBehavior {

	public TbRandomBallMovement() {
		super("randomballmovement");
	}

	// In this update method, we decide which team behavior to go to, and call
	// update
	// on this new behavior.
	public void update(GameState game, RoboTeam team) {
		boolean carrierAssigned = false;
		for (int i = 0; i < team.players.length; i++) {
			if (team.players[i].controller != null
					&& team.players[i].controller.functioning
					&& !carrierAssigned) {
				team.players[i].update(new PbBallToPosition(team.players[i],
						new Vector(300, 200)), game);
				carrierAssigned = true;
			} else
				team.players[i].update(new PbDefault(team.players[i]), game);
		}
	}

	public int behaviorValue(GameState game, RoboTeam team) {
		return 0;
	}

	public TeamBehavior copy() {
		return new TbRandomBallMovement();
	}

}
